# -*- coding: utf-8 -*-

from django.utils.translation import ugettext as _
from django.shortcuts import render

from board.models import Board, Post, Tag, PostHistory

# Create your views here.

def index(req):
    public_boards = Board.objects.select_related().filter(internal=False
        ).order_by('display_position')
    if req.user.is_authenticated() and req.user.has_perm('board.moderate'):
        internal_boards = Board.objects.select_related().filter(
            internal=True).order_by('display_position')
    else:
        internal_boards = []
    ctx = dict(public_boards=public_boards, internal_boards=internal_boards)
    return render(req, 'board/index.html', ctx)


def show_board(req, board_id, **kw):
    pass

